<template>
  <div>
    <div v-for="(item, i) in rdm" :key="i" @click="deee(i)">
      {{ item }}<button @click="dele">删除</button>
    </div>
    <button @click="cli">+</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      rdm: [
        Math.floor(Math.random() * 20),
        Math.floor(Math.random() * 20),
        Math.floor(Math.random() * 20),
      ],
      isnum: 1,
    }
  },
  methods: {
    cli() {
      this.rdm.push(Math.floor(Math.random() * 20))
    },
    dele() {
      console.log(this.rdm)
      //  this.rdm.splice()
    },
    deee(i) {
      this.rdm.splice(i, 1)
    },
  },
}
</script>

<style></style>
